package com.netease.financial.domain.interactor;

import com.netease.financial.domain.Factory;
import com.netease.financial.domain.executor.PostExecutionThread;
import com.netease.financial.domain.executor.ThreadExecutor;
import com.netease.financial.domain.repository.NfsRepository;

import rx.Observable;
import rx.Subscriber;

/**
 * Created by hzwuyufeng on 2/29/16.
 */
public class Register extends UseCase<RegisterInput> {

    private final NfsRepository nfsRepository;
    private RegisterInput registerInput;

    public Register(NfsRepository nfsRepository, ThreadExecutor threadExecutor, PostExecutionThread postExecutionThread) {
        super(threadExecutor, postExecutionThread);
        this.nfsRepository = nfsRepository;
    }

    @Override
    public void setUseCaseInput(RegisterInput registerInput) {
        this.registerInput = registerInput;
    }

    @Override
    protected Observable buildUseCaseObservable() {
        return nfsRepository.register(registerInput);
    }

}
